package com.example.showdemo;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import android.os.Bundle;

import com.example.showdemo.databinding.ActivityMainBinding;
import com.example.showdemo.model.HandleModel;
import com.example.showdemo.viewmodel.ViewModel;

public class MainActivity extends AppCompatActivity {

    private ActivityMainBinding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // 使用 databind 进行数据绑定
        binding  = DataBindingUtil.setContentView(this,R.layout.activity_main);
        ViewModel viewModel = new ViewModel();
        viewModel.setModel(new HandleModel());
        binding.setViewmodel(viewModel);
    }
}


